Memory devices and methods for use therewith

ABSTRACT

The preferred embodiments described herein provide a memory device and methods for use therewith. In one preferred embodiment, a method is presented for using a file system to dynamically respond to variability in an indicated minimum number of memory cells of first and second write-once memory devices. In another preferred embodiment, a method for overwriting data in a memory device is described in which an error code is disregarded after a destructive pattern is written. In yet another preferred embodiment, a method is presented in which, after a block of memory has been allocated for a file to be stored in a memory device, available lines in that block are determined. Another preferred embodiment relates to reserving at least one memory cell in a memory device for file structures or file system structures. A memory device is also provided in which file system structures of at least two file systems are stored in the same memory partition. Additionally, methods for permanently preventing modification of data stored in a memory device and for identifying memory cells storing data are disclosed.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of application Ser. No. 09/748,589,filed Dec. 22, 2000 (pending), which is a continuation-in-part of U.S.patent application Ser. No. 09/662,953, filed Sep. 15, 2000 (nowabandoned), each of which is incorporated by reference herein.

BACKGROUND

Non-volatile memory is becoming standard in many data storage systemssuch as digital cameras and digital audio players. Modular, portablememory devices, such as flash memory devices, are available that can bereadily connected to and disconnected from these systems. CD-based mediais also used. Regardless of the type of memory device employed, datastorage systems use a file system to control where data is located onthe device and to interface with the device. Many data storage systemsuse the DOS FAT file system. Because the DOS FAT file system requiresthat the memory device be re-writeable, the DOS FAT file system is notpreferred for write-once memory devices. While there are file systemsdesigned for write-once memory devices, such as the ISO9660 file systemused by CD-ROMs and the Universal Disk Format (UDF) used by Adaptec formulti-session CD-RWs, these file systems may not be suitable for certainapplications.

SUMMARY

The present invention is defined by the following claims, and nothing inthis section should be taken as a limitation on those claims.

By way of introduction, the preferred embodiments described belowprovide memory devices and methods for use therewith. In one preferredembodiment, a method is presented for using a file system to dynamicallyrespond to variability in an indicated minimum number of memory cells offirst and second write-once memory devices. In another preferredembodiment, a method for overwriting data in a memory device isdescribed in which an error code is disregarded after a destructivepattern is written. In yet another preferred embodiment, a method ispresented in which, after a block of memory has been allocated for afile to be stored in a memory device, available lines in that block aredetermined. Another preferred embodiment relates to reserving at leastone memory cell in a memory device for file structures or file systemstructures. A memory device is also provided in which file systemstructures of at least two file systems are stored in the same memorypartition. Additionally, methods for permanently preventing modificationof data stored in a memory device and for identifying memory cellsstoring data are disclosed.

It should be noted that the following preferred embodiments can bepracticed with any suitable memory device and that the following claimsshould not be read as requiring a write-once memory device or athree-dimensional write-once memory device unless specifically recited.It should also be noted that any or all of the following embodiments canbe used alone or in combination.

The preferred embodiments will now be described with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a data storage system and memory device ofa preferred embodiment.

FIG. 2 is an illustration of a memory array of a preferred embodimentthat is logically organized into lines, blocks, and partitions.

FIG. 3 is a block diagram of a data storage system and first and secondmemory devices of a preferred embodiment.

FIGS. 4a, 4 b, and 4 c are schematic diagrams of a plurality of memorycells of a write-once memory device of a preferred embodiment.

FIG. 5 is a block diagram of a data storage system and memory device ofanother preferred embodiment.

FIG. 6 is an illustration of a memory array of a preferred embodiment inwhich part of a memory block is filled with a first file and theremainder of the block is filled with a second file.

FIGS. 7a, 7 b, and 7 c are illustrations of how file structures of afile are reserved in a memory device of a preferred embodiment.

FIGS. 8a and 8 b are illustrations of how file system structures of apartition are reserved in a memory device of a preferred embodiment.

FIGS. 9a and 9 b are illustrations of a memory device of a preferredembodiment in which file system structures of two file systems arestored in a single memory partition.

FIGS. 10a, 10 b, and 10 c are schematic diagrams of a plurality ofmemory cells illustrating a method of identifying memory cells storingdata of a preferred embodiment.

FIG. 11 is an illustration of a memory device of a preferred embodimenthaving embedded error checking and correcting (ECC) code circuitry.

DETAILED DESCRIPTION OF THE PRESENTLY PREFERRED EMBODIMENTS Introduction

Turning now to the drawings, FIG. 1 shows a data storage system 10coupled with a memory device 20. The data storage system 10 comprises afile system 15 operative to read and write data from/to the memorydevice 20. A data storage system can take any suitable form and may, forexample, be implemented as a digital camera, a digital audio player, apersonal digital assistant, a game player, a cellular telephone, anelectronic book, or a general-purpose programmable computer. The memorydevice can also take any suitable form and, in one presently preferredembodiment, takes the form of a three-dimensional write-once memorydevice. Suitable three-dimensional write-once memory devices aredescribed in U.S. Pat. No. 6,034,882, U.S. patent application Ser. No.09/560,626 (abandoned), and U.S. patent application Ser. No. 09/638,428(abandoned), all of which are assigned to the assignee of the presentinvention and are hereby incorporated by reference. Further detailsregarding alternative structures for the memory device are presented inU.S. patent applications Ser. No. 09/638,427 (now U.S. Pat. No.6,424,581) and Ser. No. 09/638,334 (pending), both of which are assignedto the assignee of the present application and are hereby incorporatedby reference.

Three-dimensional write-once memory arrays provide important economiesin terms of reduced size of the memory array and associated reductionsin manufacturing cost. The cost advantages are important in consumerproducts such as digital cameras, digital audio players, and electronicbooks. In these applications, the write-once memory array is preferablyfield programmable, and the data storage system field programs thememory array with a desired digital medium, such as a file of one or asequence of images, a text file such as that suitable for an electronicbook, or a digital audio file.

The following preferred embodiments can be practiced with any suitablememory device, and the following claims shall not be read as requiring awrite-once memory device or a three-dimensional write-once memory deviceunless specifically recited. Also, it should be noted that any or all ofthe following embodiments can be used alone or in combination. Further,definitions stated in one section of the detailed description applyequally to all sections.

Turning again to the drawings, FIG. 2 is an illustration of a memoryarray implemented in a memory device of a preferred embodiment. In thismemory array, a plurality of memory cells are logically organized intolines, blocks, and partitions. In particular, this array is logicallyorganized into Blocks 0 to N and divided into two partitions. Partition1 contains Block 0 to Block 100, and Partition 2 contains Block 101 toBlock N. FIG. 2 also shows that Block 0 contains a plurality of lines(Line 1 to Line M), each containing a data region and an error coderegion. In this preferred embodiment, the error code region is an errorchecking and correcting (“ECC”) region, and the memory device comprisesa hardware component that writes an ECC code in the ECC region for eachline. The ECC region is preferably hidden from the file system so thatdata will only be written into the data region and not into the ECCregion. Accordingly, if each block contains 64 lines with each linehaving an 8-byte data region and a 1-byte ECC region, the file systemwill be able to write 512 bytes of data to each block. It should benoted that while FIG. 2 shows multiple lines, blocks, and partitions, amemory array can contain a single partition, a partition can contain asingle block, and a block can contain a single line.

Dynamic Line Sizing Embodiments

In one preferred embodiment, the minimum number of memory cells that thefile system can write into (i.e., the smallest writeable unit) is asingle line. It should be noted that a file system “writes” into amemory cell regardless of whether the file system changes the initialdigital state of the memory cell. For example, if the smallest writeableunit is 8 bytes, the file system “writes” 8 bytes of data even thoughsome or all of the memory cells remain in their initial logic stateafter the write operation. Also, as noted above, the ECC region of aline is hidden from the file system so data will only be written intothe data region and not into the ECC region. Accordingly, the smallestwriteable unit in this preferred embodiment is the length of a line'sdata region (e.g., 8 bytes)—not the length of a line's data region andECC region (e.g., 9 bytes).

To ensure that the file system writes into only the smallest writeableunit of a memory device, it is preferred that the memory device comprisean indication of its smallest writeable unit (i.e., its line size) andprovide this indication to the file system. The indication can be sentin response to a read command from the file system or can automaticallybe sent to the file system when the data storage system is powered-up orreset. The file system can receive this indication by sensing anelectronic, mechanical, or optical feature of the memory device. Forexample, the indication can be provided in a register in the memoryarray or in a device identification code of the memory device. Further,the indication can be stored when the memory device is formatted or canbe pre-written into the memory device by a manufacturer of the device.

With this preferred embodiment, the file system dynamically responds tovariability in an indicated minimum number of memory cells of respectivememory devices by dynamically changing the minimum number of memorycells that the file system writes to a memory device. For example, FIG.3 shows a data storage system 50 useable with first and second memorydevices 60, 65. In this embodiment, the first and second memory devices60, 65 take the form of modular, portable devices that are readilyconnected to and disconnected from the data storage system 50. The firstmemory device 60 has a line size of 8 bytes, and the second memorydevice 65 has a line size of 16 bytes. As shown in FIG. 3, when thefirst memory device 60 is coupled with the data storage system 50, thefile system 55 is instructed to write no less than 8 bytes to the firstmemory device 60 during a write operation, while when the second memorydevice 65 is used, the file system 55 writes no less than 16 bytesduring a write operation.

One advantage associated with this preferred embodiment is thatvariability in the smallest writeable unit is taken care of by the filesystem itself—not by a driver associated with the memory device. Somedata storage systems use a driver to facilitate communication betweenthe file system and a memory device coupled with the data storagesystem. For example, memory devices using the CompactFlash™ standardrequire a CompactFlash™ driver, and memory devices operating under theSmartMedia™ standard require a SmartMedia™ driver. Typically, when a newmemory device is released with a smallest writeable unit that isdifferent from that programmed into the driver, a new driver must bereleased and installed in the data storage system before the new memorydevice can be used. Because the file system of this preferred embodimentdynamically responds to the smallest writeable unit indicated by amemory device, a memory device manufacturer can redesign the smallestwriteable unit of its memory device without making a new driveravailable for the data storage system. In this way, the file system,unlike a driver, dynamically responds to variability between thesmallest writeable units of two devices.

Another advantage of this preferred embodiment relates to aligningstored data. For example, for simplicity, it may be preferred to alignfile structures (e.g., file name, description, and pointers) at thestart of each line. If the file system were not informed of a memorydevice's smallest writeable unit, misalignment in the file structuresmay occur. For example, if the file structure is 8 bytes long, the filesystem would store two file structures on the 16-byte line of the secondmemory device 65 to maximize storage space. Because the second writtenfile structure does not begin at the start of a line, the second filestructure is not aligned with the first file structure. By informing thefile system 55 that the smallest writeable unit of the second memorydevice 65 is 16 bytes, the file system 55 only writes the first filestructure on a single line and writes the second file structure on aseparate line, thereby maintaining alignment between the filestructures.

Error-Code-Related Embodiments

As noted above, in one preferred embodiment, each line of the memoryarray contains a first set of memory cells to store data (the dataregion) and a second set of memory cells to store an error coderepresenting the data stored in the first set of memory cells (the errorcode region). While the error code used to illustrate this preferredembodiment is an error checking and correcting (“ECC”) code, it shouldbe noted that other types of error codes (such as parity bits) can beused as an error code. In operation, when data is stored in the dataregion of a line, an ECC code generator determines an ECC code thatrepresents the data, and the error code is stored in the ECC region. AnECC code generator can be implemented in hardware and/or software in thedata storage system or the memory device. For example, the file systemcan include software to generate ECC codes, or the memory device caninclude a hardware component that generates ECC codes.

As described above, ECC code circuitry can be implemented external to orinternal to the memory device. ECC code circuitry can impose an accesstime penalty approximately equivalent to 50-75 gate delays. Some memorydevices implement ECC code circuitry in one or more chips separate fromthe memory device to avoid this penalty, which may degrade performanceto an unacceptable level. Other memory devices, however, are optimizedfor high density and low cost and are not necessarily optimized foraccess speed. One such memory device is the three-dimensional,write-once electronic memory device discussed in U.S. Pat. No.6,034,882. With these memory devices, the delays associated withintegrated ECC code circuitry are relatively unimportant, and the use ofintegrated ECC code circuitry may be preferred since manufacturingdefects and/or age-related fatigue can raise the probability of biterrors.

Turning again to the drawings, FIG. 11 is an illustration of a memorydevice 200 of a preferred embodiment. The memory device 200 can take anysuitable form. In one preferred embodiment, the memory device 200 takesthe form of a write-once memory device, while in another preferredembodiment, the memory device 200 takes the form of a three-dimensionalelectronic memory device. Some examples of electronic memory devicesinclude, but are not limited to, asemiconductor-transistor-technology-based memory device (e.g., CMOS,bipolar, SiGe, GaAs), a magnetic-based memory device (e.g., magnetictunnel junction (MTJ) memories), and an organic-electronics-based memorydevice. An optical memory device (e.g., CD-ROM) can also be used.

The memory device 200 of FIG. 11 comprises a plurality of memory cells210 and ECC code circuitry 220 integrated with/embedded in the memorydevice 200. The ECC code circuitry 220 comprises an ECC code generator230 and an ECC code decoder 240. The ECC code generator 230 accepts ndata bits to be stored in the memory cells 210 as input and produces pECC code bits as output. The n data bits are stored with the p ECC codebits as a k-bit word in the memory cells 210. Preferably the ECC codecircuitry 220 implements a Hamming (k, n) code scheme (e.g., a Hamming(72, 64) code scheme).

When the k stored bits are retrieved from the memory cells 210, they arefed through the ECC code decoder 240. The ECC code circuitry 220compares the parity bits computed from k (out of n) retrieved bits andcompares those parity bits with the ones stored. If there is a mismatch,the ECC code circuitry 220 corrects the error (if one bit). The ncorrected data bits are then outputted by the ECC code decoder 240. Witha Hamming (72, 64) code scheme, the 8 ECC code bits are used to identifyand correct any single-bit error in the 72-bits of stored data. (Thepresence of two errors in the 64-bit word can be determined but notcorrected.) Accordingly, the Hamming (72, 64) code scheme permits thememory device 200 to tolerate one defective bit out of every 72 bits.This defect rate (about 1.4%) exceeds the defect percentages encounteredin typical integrated circuit manufacturing.

In one preferred embodiment, the data bits and ECC code bits are storedin memory cells using the distributed data strategy described in U.S.patent application Ser. No. 09/747,574 (pending), filed on the same dateas the present application. That application, which is assigned to theassignee of the present invention, is incorporated by reference herein.U.S. patent application Ser. No. 09/748,649 (pending), which is alsoassigned to the assignee of the present invention and incorporated byreference herein, provides additional information concerning theseconcepts.

As described above, an ECC code generator implements an algorithm(preferably based on the Hamming Code) to generate an output using thedata to be stored in the data region as input. When data is written intoand/or read from the data region, the written/read data is compared tothe ECC code. For example, when data is read from the data region, theECC generator can generate an ECC code based on the read data andcompare that newly-generated ECC code with the ECC code stored in theECC region. An error indication is provided to the data storage systemif the ECC codes do not match. The ECC codes can then be decrypted todetermine which bit(s) in the data is incorrect so that the erroneousbit(s) can be corrected. There are situations, however, where a mismatchbetween the newly-generated ECC code and the ECC code stored in the ECCregion does not indicate an error. One such situation can occur withwrite-once memory devices.

In spite of its many advantages, a write-once memory array provides thedisadvantage that a memory cell cannot be erased once it is writteninto. Accordingly, it is not possible to erase files from a write-oncememory array by restoring the associated memory cells to their initial,un-programmed digital state (e.g., Logic 0). Novel methods for deletingstored data from write-once memory devices are presented in U.S. patentapplication Ser. No. 09/638,439 (pending), filed Aug. 14, 2000, which isassigned to the assignee of the present invention and is herebyincorporated by reference. As described in that patent application, datacan be deleted (i.e., made difficult or impossible to read) byoverwriting at least a portion of the stored data with a destructivepattern. This destructive pattern switches at least some of the memorycells associated with the stored data from an original, un-programmedstate to a programmed state. For example, some or all of the memorycells associated with stored data can be over-written with thedestructive pattern (111111). Any suitable destructive pattern (periodicor aperiodic) that achieves the desired result of obliterating the datacan be used.

FIGS. 4a through 4 c provide a specific example of this operation for awrite-once memory. FIG. 4a shows data (10011001) stored in the dataregion of a line. The error code representing the data (00101) is storedin the ECC region. To delete or obliterate this data, the destructivepattern (10101010) shown in FIG. 4b is written into the data region ofthe line. Because the memory device is a write-once device, only theun-programmed bits are affected by this write operation. Accordingly,the data stored in the data region after the destructive pattern iswritten is the OR of the original data (10011001) and the destructivepattern (10101010). The result (10111011) is shown in FIG. 4c. When thedestructive pattern is written into the data region, the error coderepresenting that pattern ((11000), as shown in FIG. 4b) is also writteninto the ECC region of the line. However, because only un-programmedbits are affected by a write operation in a write-once memory device,the resulting error code in the ECC region will be the OR of theoriginal ECC code (00101) and the ECC code of the destructive pattern(11000). The result ((11101), shown in FIG. 4c), however, does notrepresent the data stored in the data region (10111011). Accordingly, acomparison of the ECC code with the data stored in the data region willindicate a false error. Such a false error may have the undesired effectof re-writing or correcting the data properly stored in the data region.

To overcome this problem, it is preferred that the file system disregardthe error code for “deleted” data. For example, an indication that thedata is deleted can be stored by the file system in the form of a flagbit designated in a file listing or an entry stored in a table ofdeleted data. In this way, to determine whether data is deleted data,the file system determines whether such an indication was stored.Alternatively, the file system can recognize deleted data by recognizingthat the data stored in the data region is the destructive pattern. Forexample, if the destructive pattern is a series of 1′s, the resultingdata will also be a series of 1′s. If the error codes do not match inthis situation, it is likely that the data is deleted data, and the filesystem can disregard the error code. “Disregard the error code” isintended to broadly refer to any act or omission that prevents theundesired effect of re-writing or correcting the data properly stored inthe data region. For example, an error code can be disregarded bydisabling a comparison of the data stored in the data region with theerror code or can be disregarded by ignoring an error resulting fromsuch a comparison.

It is should be noted that the set of memory cells can be other than adata region of a line. For example, the set of memory cells storing datacan be a block of lines. Also, while the error code region wasassociated with a single line in the above-described preferredembodiment, an error code region can be associated with a block of linesor with a file. Further, the term “set” is intended to refer to one ormore, and the unprogrammed digital state can be either Logic 0 or Logic1 (or Logic 2 in a three-state digital system).

Micro-Allocator Embodiments

As described above, in one preferred embodiment, the memory device islogically organized into a plurality of blocks, each block comprising aplurality of lines. The term “block” as applied to memory cells refersto a contiguous set of memory cells. With reference to FIG. 5, to storea file in a memory device 70, an allocator 75 of a file system 80determines the size of the file that is to be stored and allocates anappropriate number of blocks in the memory device 70 for storing thefile. As shown in the example illustrated in FIG. 6, Blocks 1-4 areallocated for a first file. Although four blocks are allocated, thefirst file may not completely fill one of the blocks. This may occur,for instance, with a small file or with a large file that has beensegmented into smaller portions. This may also occur with a smallremainder of a file after it has already filled other blocks, asillustrated in Block 4 of FIG. 6. The first file only partially fillsBlock 4, leaving Lines 4-6 available. Because the allocator 75 onlyallocates memory in block units, when a second file is to be stored inthe memory device 70, the allocator 75 allocates additional blocks forthe second file (e.g., Blocks 5-10) and leaves the available space inLines 4-6 of Block 4 unfilled.

To prevent wasting of available memory space, it is preferred that thefile system 80 comprise a micro-allocator 85 to keep track of a block(preferably, each block) and report which lines have been used (or whichlines are available) to a block-tracking device such as an allocationtable. This provides the advantage of using lines that otherwise wouldhave been wasted. With the use of a micro-allocator 85, available Lines4-6 can be used to store a second file, as shown in FIG. 6. If there areremaining portions of the second file to be stored, the allocator 75would then determine the size of the remaining portions and allocate anappropriate number of blocks in the memory device 70. The remainingportions of the second file would then be stored in the allocatedblocks, with the micro-allocator 85 determining which lines areavailable in the allocated block. As is clear from this example, theterm “file” refers to either a complete file or a portion of a file,such as the portion of the first file stored in Lines 1-3 of Block 4.

In an alternate embodiment, instead of allocating blocks in the memorydevice 70 itself, the allocator 75 can allocate blocks in a memory cache90 (e.g., RAM) of the data storage system 95. In this way, data can becached prior to actually committing it to the memory device 70. In thisembodiment, the allocator 75 would allocate blocks held in the cache 90,the micro-allocator 85 would track line usage of the cached block, andthe file system 80 would store the cached data in the memory device 70when the cached block is full. Use of this alternate embodiment may beespecially desired when the memory device 70 takes the form of awrite-once memory device. Because stored data cannot be over-written ina write-once memory device, the file system cannot re-organize storeddata as it can with a write-many memory device. By using this preferredembodiment, the allocator 75 can allocate a number of blocks into thecache 90, and the file system 80 can use the cache 90 as a workspace inwhich to write and re-write data. For example, if the blocks of FIG. 6were allocated in the cache 90, the file system 80 could move Lines 4-6of Block 4 to another block closer to the remainder of the second file.The micro-allocator 85 could then indicate that Lines 4-6 were availablefor additional data. After those lines are filled, the file system 80could store Block 4 in the write-once memory device. Of course, a cachedblock can be written to the memory device before the cached block isfilled.

“Skid Pad” Embodiments

As described above, when a file is stored to the memory device, theallocator determines how many blocks to allocate in the memory device.After the file is stored, the file system stores a file structure forthat file in the memory device. The term “file structure” is intended torefer to data that describes a file. In one embodiment, a file structuredescribes a file and how a file system can use the file. For example, afile structure can describe the name, type, location, size, and otherattributes of a file, as well as the type of commands that a file systemcan or cannot use with that file. For instance, a file structure canindicate that a file is “read-only” and, accordingly, cannot be modifiedby a file system. As another example, the file structure can be a file“footer,” which can be a data pattern indicating that the file stored inthe block is complete or a pointer to a memory location storing the nextportion of the file (or to a table storing such a pointer). Of course,other file structures in addition to these examples can be used.

Because file structures are written after a file is stored in memory,problems can arise with write-once memory devices if all of theallocated space for that file is filled before the file structures canbe written. For example, if the data storage system records a digitalrepresentation of streaming data (e g., voice data), the streaming datacan fill the entire allocated memory space, leaving no room for filestructures. Because file structures have not been written, when the filesystem reads the stored data, it will not know whether the file iscomplete or where to look for the additional portions of the file. Asimilar problem is encountered if a catastrophic failure occurs duringthe write operation (such as a power failure or a user removing thememory device from the data storage system). With a write-many memorydevice, the file structure can be stored at another memory location, andthe file system can later re-organize the stored data to place the filestructure with the stored file. However, this re-organization is notpossible with write-once memory devices.

To overcome this difficulty, when the file system writes a file to ablock (or any other type of contiguous set of memory cells, such as aline), the file system preferably reserves at least one memory cell inthe block for file structures for that file. In this way, the filesystem creates a “skid pad” in the block for the file structures. It ispreferred that this “skid pad” not be visible to an end user so thatfiles too large to fit in the unreserved memory cells will not beattempted to be written into the reserved memory space.

The use of a “skid pad” will now be illustrated in conjunction withFIGS. 7a-7 c. As shown in FIG. 7a, Line 6 of a block is reserved forfile structures of a file to be saved in that block. The number ofmemory cells reserved for file structures can be determined by the filesystem. When a file is stored in the block, only those lines that arenot reserved for the file structures are used to store the file (Lines1-5). If the file is more than five lines long, the file structure forthe file is stored in Line 6, as shown in FIG. 7b. If the file structurecan be stored in the unreserved memory cells, the reserved memory cellscan be used to store other data. For example, if Line 6 in FIG. 7a werereserved for the file structures of a first file and the file systemwere able to save file structures for the file in an unreserved line (asshown in FIG. 7c), Line 6 can be used to store other data. In FIG. 7c,Line 6 is “re-used” as reserved space for the file structures of asecond file being stored to that block.

The “skid pad” concept can also be used for file system structures.Whereas a file structure refers to data that describes a particularfile, a “file system structure” refers to any data that describes apartition in memory, the memory space within the partition, and/or thetype of commands that a file system can or cannot use with thatpartition. For example, a file system structure can be data describingwhere a file resides and can be used by a file system to find that fileor free memory cells in a memory device. As another example, a filesystem structure can indicate that a partition is “closed” and,accordingly, cannot be modified by a file system. A file systemstructure can take the form of an allocation table, a listing of storedfiles, a search tree, a boot block, a partition header, a partitionfooter, a description of contents of the memory device, andconfiguration information, as well as a listing of the file structuresof the files stored in a partition. Of course, other file systemstructures in addition to those listed above can be used. FIGS. 8a and 8b illustrate this embodiment. When the file system creates a partitionin the memory device, the file system reserves at least one memorylocation for file system structures of the partition (here, the firstand last block of the partition). The file system stores files in thepartition in any unreserved memory location, as shown in FIG. 8b. Inthis way, if the partition is completely filled with files, there willbe room for file system structures of the partition. Further, a filesystem may expect to find file system structures at certain memorylocations. Reserving space in the memory for file system structuresensures that other data (such as a file) will not be written into thoselocations.

Multiple-File-System-Structures Embodiments

In another preferred embodiment, a memory device is presented where filesystems structures for two or more different file systems are stored inthe same partition of a memory device, such as the memory device shownin FIG. 9b. Preferably, a partition comprises a set of memory cells witha single addressing scheme. By storing file systems structures formultiple file systems in the same partition of a memory device, thememory device can be read by a larger number of media readers. Forexample, a data storage system such as a digital camera can store filesystem structures for multiple file systems to ensure that picturesstored on the memory device can be read by a prominent file system. Inoperation, once the memory device is filled with pictures and filesystem structures of one file system are stored in the memory device,the digital camera can “close” the memory device by storing file systemstructures of additional file systems. For example, the camera can storeDOS FAT file structures (e.g., FAT Table, boot sector, etc.) so that thememory device can be read on any DOS reader as well as a reader usingthe primary file system.

The file system structures for the additional file systems can bewritten to the memory device in response to a request from a user, suchas when the user provides an indication to the data storage system thathe does not want to store any more data on the memory device. Inresponse to this indication, the file system or another application ofthe data storage system can add the file system structures for the otherfile systems. Alternatively, the file system can automatically write theadditional file system structures when the file system detects that thememory device is full or virtually full.

With write-once memory devices, if the locations for file systemstructures of a file system are written with data, the file systemstructures of that file system will not be able to be written onto thememory device. Accordingly, to leave open the option of writingadditional file system structures of other files systems, the “skid pad”concept discussed above can be used. That is, after a partition iscreated in the memory device, memory cells are reserved in theappropriate locations in the partition for file system structures of theadditional file systems. As an example, if one wanted to close thememory device to be DOS FAT compatible, the first address of the memorydevice would be reserved for the boot sector structure. As a simplifiedexample of this, consider FIGS. 9a and 9 b. FIG. 9a shows that Block 0in Partition 1 is reserved for file system structures of a first filesystem and that Block 100 in Partition 1 is reserved for file systemstructures of a second file system. The file system structures of thefirst and second file systems are later stored in their respectivereserved locations, as shown in FIG. 9b. While FIG. 9b shows file systemstructures of two file system stored in a single partition in the memorydevice, it should be noted that file system structures of more than twofile systems can be stored.

Closing-the-Media Embodiments

In another preferred embodiment, data stored on a memory device, such asa file or a partition, is permanently prevented from being modified(i.e., the data is “locked” or “closed”). In many situations, it isdesirable to modify data stored in a memory device. However, there areother situations in which one wishes to prevent the stored data fromever being modified. For example, consider the situation in which amemory device stores executable code (e.g., for a video game or adigital book) in one partition and user information (e.g., for highscores or notes) in another partition. In this situation, it may bedesired to prevent the executable code from being modified. As anotherexample, it may be desired to prevent user-stored information (such as apicture taken with a digital camera) from being erased or changed onceit is stored. Some re-writeable media, such as hard disks, can store aread-only or an archive flag along with data that is to be protectedfrom modification. However, because such flags can removed, this methodof protection does not ensure that the data will never be modified.Further, the use of write-once media alone does not ensure permanentprotection of data because, as described above, stored data can bemodified by overwriting the data with a destructive pattern (i e.,switching memory cells from an un-programmed to a programmed state).

In one preferred embodiment, a file is permanently prevented from beingmodified by storing an indicator in a file structure of the file. Anyfile system reading that file structure would be prevented frommodifying the file and would be programmed to prevent modification orremoval of the indicator. Alternatively, if a write-once memory deviceis used, the media itself ensures that the indicator is non-modifiableif the indicator is in a programmed state. In another preferredembodiment, a partition is permanently prevented from being modified bypermanently preventing the file system from allocating memory cells inthe protected partition. In one implementation, the file system'sallocator is disabled, thereby preventing the file system fromallocating any blocks of memory in the partition. In anotherimplementation, the file system's allocator is replaced by anotherallocator that is given no space to allocate. Similar to protectingfiles, a partition can be permanently protected by storing an indicatorin a file system structure of the partition, and a file system readingthat file system structure would be prevented from modifying thepartition. As above, a file system can be programmed to preventmodification or removal of this indicator or, if a write-once memorydevice is used, the media itself ensures that the indicator isnon-modifiable if the indicator is in a programmed state. With thesepreferred embodiments, the protected data (files or partitions) ispermanently and finally “locked” or “closed.”

Temporal-to-Spatial Mapping Embodiments

Turning again to the drawings, FIGS. 10a-10 c illustrate a method foridentifying memory cells storing data in a memory device of a preferredembodiment. This method provides the advantage of locating stored datawhen the location of the data is not known to the file system a priori.FIG. 10a shows a set of memory cells. The first line of memory cellsstores data (1101), and the remaining five lines of memory cells storean identification pattern (0000). FIG. 10b shows additional data (1110)stored in the second line of memory cells (i.e, between the memory cellsstoring the previously-stored data (1101) and the memory cells storingthe identification pattern (0000)) by overwriting the identificationpattern stored in the second line. To identify the memory cells thatstore the newly-written data (1110), the file system identifies thosecells that are adjacent to the memory cells storing the identificationpattern. For example, the file system can be programmed to identify thememory cells that are within a predetermined number of memory cellsadjacent to the memory cells storing the identification pattern (e.g.,four memory cells or one line). Alternatively, the file system can beprogrammed to identify the memory cells that are between two sets ofmemory cells storing the identification pattern. For example, in FIG.10c, data (0110) and (1001) are identified because they are locatedbetween the memory cells storing the identification pattern (0000) inthe third and sixth lines of the memory array.

This method for identifying memory cells provides particular advantagesfor write-once memory devices. These advantages will be discussed interms of storing data describing a file. It should be noted that themethod and its associated advantages are equally applicable to otherapplications. File listings in a memory device often store the name andattributes (such as date and time created, read-only, executable, etc.)of a file and a pointer listing the address where the file is actuallycontained in the memory. If the file is later moved in memory, the filesystem simply writes the new address of the file over the old address ofthe file. Similarly, if a new file is later stored at the addressindicated by the pointer, the file system can write the name of the newfile over the name of the old file. Accordingly, if data changes afterit is stored, the modified data is written over the previously-storeddata at the same location. This technique of modifying data will bereferred to as temporal mapping —although data changes at a later time,its location remains the same. For this reason, the file system knowsexactly where to locate data. For example, the pointer to a specificfile will always be in the same location regardless of whether thepointer to that file changes.

Because a write-once memory device cannot re-write over apreviously-written location, the temporal mapping technique describedabove cannot be used with a write-once memory device. Instead, new datais written to a new location. When new data is written, it is preferredthat the old data be deleted using the deletion method described aboveand in U.S. patent application Ser. No. 09/638,439 (pending), filed Aug.14, 2000, to ensure that the file system does not recognize the originaldata (e.g., pointers) as the current data. To determine the location ofthe new data, it is preferred that the identifying technique describedabove be used. This technique will be referred to as spatial mapping (incontrast to temporal mapping) when data changes at a later time, itslocation also changes.

Turning again to FIGS. 10a-10 c, data (1101) represents a pointer to aparticular file. Here, the memory cells storing the identificationpattern are all in an unprogrammed logic state (e.g., Logic 0). When thelocation of the file changes, a new pointer (1110) is written to thememory device (see FIG. 10b) by overwriting the identification patternin the next available line. To identify the location of the new pointer,the file system locates the memory cells that are adjacent to the memorycells in the un-programmed Logic 0 state. That is, the file systemrecognizes the string of zeros to mean that the data stored before thestring of zeros is the current data. In this way, writing new pointersover existing zeros, while leaving more zeros at the end of the memorycells, allows the file system to recognize which pointers are the mostcurrent. In essence, the task of finding the most current data reducesto merely finding the last nonzero entry in the memory cells. If theentire set of memory cells storing an identification pattern isoverwritten, additional modifications may not be possible. To avoid thissituation, it is preferred that the pointer point to an additionalpointer tree (instead of to the file itself) to increase the number ofmodifies that can occur.

In the preceding example, it was assumed that the file system wasprogrammed to identify a line of data that is adjacent to the memorycells storing the identification pattern. In this way, the identifieddata was of a predetermined size (i e., a predetermined number of memorycells, such as a line). To identify data of a variable size, the filesystem can be programmed to identify memory cells that are between twosets of memory cells storing the identification pattern, as shown inFIG. 10c. Additionally, when the old data is deleted with a destructivepattern that results in a predetermined pattern of data being stored inthe old location (e.g., a string of ones), the file system can beprogrammed to identify the memory cells that are between a set of memorycells storing the predetermined pattern of data (e.g., the string ofones) and a set of memory cells storing the identification pattern(e.g., the string of zeros). In this situation, the file system ispreferably programmed to ignore the predetermined pattern rather thanrecognize it as valid data.

Although the spatial mapping technique was illustrated above inconjunction with file descriptors and pointers, this technique can beused in any other suitable application in which data is updated. Forexample, this technique can be used in a calendaring application (whereentries to a particular time or date in a calendar change over time) orin a picture editing application (where new picture are stored) run by adata storage system coupled with the memory device. The abovedescription of the operation and advantages of this technique appliesequally to these other applications. Additionally, while the precedingillustration used a string of 0s as an identification pattern, otheridentification patterns can be used to achieve the desired result ofidentifying stored data. For example, instead of the identificationpattern being a string of memory cells in their un-programmed logicstate (e.g., Logic 0), the identification pattern can be a string ofmemory cells, some of which are in their un-programmed logic state andsome of which are in a programmed logic state (e.g., (0011)).

In another preferred embodiment, the location of data stored in a firstset of memory cells of a memory device is identified by an identifierthat is stored adjacent to the data. For example, an identifier can bestored in the middle or at an end (the beginning or the end) of thestored data. The identifier would instruct the file system how muchmemory on one or both sides of the identifier is data. The identifiercan be fixed or dynamic. For example, instead of using the sameidentifier each time new data is written to the memory device, theidentifier can change to indicate that new data is being written or toindicate how many times new data has been written to the memory device.In one embodiment, the length of the identifier changes with each newdata write, while in another preferred embodiment, data stored in theidentifier itself changes. For example, an incrementing, multiplying, orincrementing alternating pattern can be used to provide the indication.In yet another preferred embodiment, the identifier is added to the endof the stored data indicating whether the stored data is valid orinvalid. For example, one bit can be added to a line or block. If thebit is not present, the file system would know that the preceding datais valid. Conversely, if the bit is present, the file system wouldignore the data.

The forgoing detailed description has described only a few of the manypossible implementations of the present invention. For this reason, thisdetailed description is intended by way of illustration, and not by wayof limitation. It is only the following claims, including allequivalents, that are intended to define the scope of this invention.

What is claimed is:
 1. A method for storing a file in a contiguous setof memory cells in a memory device, the method comprising: (a) reservingat least one memory cell in a contiguous set of memory cells for a filestructure of a file to be stored in the contiguous set of memory cells;(b) storing the file in the contiguous set of memory cells, wherein thefile is stored only in unreserved memory cells; and (c) if there areenough unreserved memory cells in the continuous set of memory cells tostore the file structure: (c1) storing the file structure in theunreserved memory cells; and (c2) storing a second file in the at leastone memory cell reserved for the file (d) if there are not enoughunreserved memory cells in the contiguous set of memory cells to storethe file structure, storing the file structure in the reserved at leastone memory cell.
 2. The method of claim 1 further comprising, before theact of reserving, determining a number of memory cells needed to storethe file structure.
 3. The method of claim 1, wherein the file structurecomprises a file structure selected from the group consisting of a filefooter, a file name, a file attribute, and a file descriptor.
 4. Themethod of claim 1, wherein the reserved at least one memory cell is atan end of the contiguous set of memory cells.
 5. The method of claim 1,wherein the memory device is logically organized into a plurality ofblocks, each block comprising a plurality of lines; and wherein thereserved at least one memory cell comprises a line.
 6. The method ofclaim 5, wherein a line comprises a minimum number of memory cells thatcan be written into during a write operation.
 7. The method of claim 1,wherein the memory device is logically organized into a plurality ofblocks, each block comprising at least one line; and wherein thereserved at least one memory cell comprises a block.
 8. The method ofclaim 7, wherein a line comprises a minimum number of memory cells thatcan be written into during a write operation.
 9. The method of claim 1,wherein the memory device comprises a write-once memory device.
 10. Themethod of claim 1, wherein the memory device comprises athree-dimensional write-once memory device.
 11. A method forpartitioning memory cells in a write-once memory device comprising aplurality of memory cells, the method comprising: (a) creating apartition of memory cells in a write-once memory device; (b) reservingat least one memory cell in the partition for a file system structure ofthe partition; (c) storing a file in the partition, wherein the file isstored only in unreserved memory cells in the partition; and (d) ifthere are enough unreserved memory cells in the partition to store thefile system structure: (d1) storing the file system structure in theunreserved memory cells: and (d2) storing a second file in the at leastone memory cell reserved for the file system structure; (e) if there arenot enough unreserved memory cells in the partition to store the filesystem structure, storing the file system structure in the reserved atleast one memory cell.
 12. The method of claim 11 further comprising,before the act of reserving, determining a number of memory cells neededto store the file system structure.
 13. The method of claim 11 whereinthe file system structure comprises a file system structure selectedfrom the group consisting of an allocation table, a listing of storedfiles, a search tree, a boot block, a partition header, a partitionfooter, a description of contents of the write-once memory device, andconfiguration information.
 14. The method of claim 11, furthercomprising: (e) locating a file or free memory cells in the partitionusing the file system structure stored in the reserved at least onememory cell.
 15. The method of claim 11, wherein the reserved at leastone memory cell is at an end of the partition.
 16. The method of claim11, wherein the memory device is logically organized into a plurality ofblocks, each block comprising a plurality of lines; and wherein thereserved at least one memory cell comprises a line.
 17. The method ofclaim 16, wherein a line comprises a minimum number of memory cells thatcan be written into during a write operation.
 18. The method of claim11, wherein the memory device is logically organized into a plurality ofblocks, each block comprising at least one line; and wherein thereserved at least one memory cell comprises a block.
 19. The method ofclaim 18, wherein a line comprises a minimum number of memory cells thatcan be written into during a write operation.
 20. The method of claim11, wherein the memory device comprises a three-dimensional write-oncememory device.